
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0,minimum-scale=1.0, maximum-scale=1.0,user-scalable=no">
<title>qrcode</title>
<script src="../jsLibs/jquery-2.x.js" ></script>
<script src="../jsLibs/qrcode.jqm4.js?_v=12" ></script>
<style type="text/css">

.out{ width:100%; max-width:640px; text-align:center; padding:1rem; margin:auto; }
.qrcode{ margin:auto; }
table{  }

</style>

</head>

<body>

<div class="out">
    <p>https://gitee.com/jroam/qrcode.js/</p>
    <div id='qrCanvas'></div>
</div>

<script>
var logo = 'http://txjia.com/peace/static/logo2.jpg';
//logo = 'https://tool.css-js.com/static/images/logo.svg';
$('#qrCanvas').qrcode({
    text: "http://txjia.com/imcat/home.php/cargo#我是中文abd",
    width: "420",          //二维码的宽度
    height: "420",         //二维码的高度
    //background: "#fff", //二维码的后景色
    //foreground: "#000", //二维码的前景色
    src: logo,      //二维码中间的图片
    correctLevel: 2 //容错级别
 }); 

/*
    render: "canvas", //canvas.方式(默认), table.方式（不支持icon,去掉代码备份入下）
    d=function(){var d,e,f,g,h,i,c=new QRCode(b.typeNumber,b.correctLevel);
      for(c.addData(utf16to8(b.text)),c.make(),d=a("<table></table>").css("width",b.width+"px").css("height",b.height+"px").css("border","0px").css("border-collapse","collapse").css("background-color",b.background),
      e=b.width/c.getModuleCount(),f=b.height/c.getModuleCount(),g=0;g<c.getModuleCount();g++){for(h=a("<tr></tr>").css("height",f+"px").appendTo(d),
      i=0;i<c.getModuleCount();i++){a("<td></td>").css("width",e+"px").css("background-color",c.isDark(g,i)?b.foreground:b.background).appendTo(h)}}
    return d},
    this.each(function(){var e="canvas"==b.render?c():d();a(e).appendTo(this)})
*/

</script>


</body>
</html>

